9f48c3ff54dda90d94a4b854f3594faec524c465,src/main/java/ch/iterate/openstack/swift/handler/AuthenticationJson11ResponseHandler.java,AuthenticationJson11ResponseHandler,handleResponse,#HttpResponse#,30

Before Change


            }
            JSONObject json;
            try {
                json = (JSONObject) JSONValue.parseWithException(new InputStreamReader(response.getEntity().getContent(), charset));
            }
            catch(ParseException e) {
                throw new GenericException(e.getMessage(), e);
            }
            JSONObject auth = (JSONObject) json.get("auth");
            String token = ((JSONObject) auth.get("token")).get("id").toString();

            Map<String, String> cdnUrls = new HashMap<String, String>();
            JSONObject serviceCatalog = (JSONObject) auth.get("serviceCatalog");
            for(Object cloudFilesCDN : (JSONArray) serviceCatalog.get("cloudFilesCDN")) {
                String regionId = ((JSONObject) cloudFilesCDN).get("region").toString();
                String publicUrl = ((JSONObject) cloudFilesCDN).get("publicURL").toString();
                cdnUrls.put(regionId, publicUrl);
            }
            Set<Region> regions = new HashSet<Region>();

After Change


            try {
                final JsonParser parser = new JsonParser();
                final JsonObject json = parser.parse(new InputStreamReader(response.getEntity().getContent(), charset)).getAsJsonObject();
                final JsonObject auth = json.getAsJsonObject("auth");
                final String token = auth.getAsJsonObject("token").get("id").getAsString();
                final Map<String, String> cdnUrls = new HashMap<String, String>();
                JsonObject serviceCatalog = auth.getAsJsonObject("serviceCatalog");
                for(JsonElement e : serviceCatalog.getAsJsonArray("cloudFilesCDN")) {
                    final JsonObject cloudFilesCDN = e.getAsJsonObject();
                    String regionId = cloudFilesCDN.get("region").getAsString();
                    String publicUrl = cloudFilesCDN.get("publicURL").getAsString();
                    cdnUrls.put(regionId, publicUrl);